<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp" %>
<%@taglib uri="http://www.framework.com/taglib" prefix="frame" %>
<head>
    <title>公共平台 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 样式文件的引入 -->
    <link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
    <!-- jqueryUI JS文件的引入 -->
    <script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
    <!-- jqueryUI国际化 -->
    <script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
    <!-- 开发使用的公用js方法 -->
    <script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
    <!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
    <script type="text/javascript">var ctx = '${ctx}';
    var actionExt = "action";
    var i18n = new Object();</script>
    <script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
</head>

<body>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'north',border:false" style="padding: 4px;height: 80px;overflow: hidden;">
        <div class="easyui-panel" data-options="fit:true,border:true">
            <div class="queryContent">
                <form name="searchProjectsForm" id="searchProjectsForm" method="post" action="" style="display: none; ">
                    <table class="queryTable">
                        <tbody>
                        <tr>
                            <th>项目名称</th>
                            <td width="10%">
                                <input id="auctionName" class="easyui-validatebox" type="text" name="auctionName"
                                       maxlength="50" style="width:120px;height: 15px;"/>
                            </td>
                            <th>项目编号</th>
                            <td>
                                <input id="code" class="easyui-validatebox" type="text" name="code" maxlength="20"
                                       style="width:120px;height: 15px;"/>
                            </td>
                            <th>项目类型</th>
                            <td width="10%">
                                <select class="easyui-combobox" name="catagoryId" style="width:120px;height: 25px;"
                                        maxlength="20" data-options="">
                                    <option value="">--请选择--</option>
                                    <c:forEach items="${projectTypeList}" var="type">
                                        <option value="${type.id}">${type.name}</option>
                                    </c:forEach>
                                </select>
                            </td>
                            <!--
								<th >资金来源</th>
							<td>
							 	<select id="moneySource" style="width:120px" class="easyui-combobox" name="moneySource">
							 		<option value="">--请选择--</option>
									<c:forEach items="${frame:dictChildren('moneySource')}" var="type">
										<option value="${type.value}">${type.name}</option>
									</c:forEach>
								</select>
							</td>
							 -->
                            <th>状态</th>
                            <td>
                                <select id="status" style="width:120px;height: 25px;" class="easyui-combobox"
                                        name="status">
                                    <option value="">--请选择--</option>
                                    <c:forEach items="${frame:dictChildren('proj_status')}" var="type">
                                        <option value="${type.value}">${type.name}</option>
                                    </c:forEach>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>创建时间</th>
                            <td>
                                <input id="startTime" class="easyui-datebox" type="text" name="startTime"
                                       data-options="validType:['dateTimeLessCompare[\'stopTime\']']" maxlength="20"
                                       style="width:120px;height: 25px;"/>-<input id="stopTime" class="easyui-datebox"
                                                                                  type="text"
                                                                                  data-options="validType:['dateTimeMoreCompare[\'startTime\']']"
                                                                                  name="stopTime" maxlength="20"
                                                                                  style="width:120px;height: 25px;"/>
                            </td>
                            <th>开标时间</th>
                            <td>
                                <input id="startTime" class="easyui-datebox" type="text" name="bidTime"
                                       data-options="validType:['dateTimeLessCompare[\'stopTime\']']" maxlength="20"
                                       style="width:120px;height: 25px;"/>-<input id="stopTime" class="easyui-datebox"
                                                                                  type="text"
                                                                                  data-options="validType:['dateTimeMoreCompare[\'startTime\']']"
                                                                                  name="bidStopTime" maxlength="20"
                                                                                  style="width:120px;height: 25px;"/>
                            </td>
                            <!--
                            <th>预算金额(元)</th>
                            <td>
                                 <input id="startMoney" class="easyui-validatebox" type="text" name="startMoney"  data-options="validType:['rangeLessCompare[\'endMoney\']']" maxlength="20" style="width:120px"/>-<input id="endMoney" class="easyui-validatebox" type="text"  data-options="validType:['rangeMoreCompare[\'startMoney\']']" name="endMoney" maxlength="20" style="width:120px"/>
                            </td>
                            -->
                            <th></th>
                            <td align="right" colspan="3">
                                <a href="javascript:void(0);" class="easyui-linkbutton" id="searchProjects"
                                   iconcls="icon-search" plain="true">查询</a>
                                <a href="javascript:void(0);" class="easyui-linkbutton" id="resetsearchProjects"
                                   iconcls="icon-reset" plain="true">清空</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <div data-options="region:'center',border:false" style="padding: 4px;">
        <table id="listProjectsTable" class="easyui-datagrid"
               data-options="singleSelect:false,toolbar:'#goodstb',method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
					pagination:true,multiSort:true,remoteSort:true,striped:true,onLoadSuccess:function(data){$('#'+projectsParamObj.searchID).attr('disabled',false);},
					url:'${ctx}/auction/business/list?roleId=centerAuditor'" }>
            <thead>
            <tr>
                <th data-options="field:'auctionName',width:170,title:'项目名称',sortable:true" align="center"></th>
                <th data-options="field:'code',width:90,title:'项目编号',sortable:true" align="center"></th>
                <th data-options="field:'catagoryName',width:80,title:'项目类型',sortable:true" align="center"></th>
                <th data-options="field:'ownerName',width:120,title:'产权人',sortable:true" align="center"></th>
                <th data-options="field:'auditName',width:100,title:'中心审核人',sortable:true" align="center"></th>
                <th data-options="field:'createTime',width:100,title:'创建时间',sortable:true" align="center"></th>
                <th data-options="field:'auctionStart',width:80,title:'竞拍时间 ',sortable:true" align="center"></th>
                <th data-options="field:'statusName',width:80,title:'状态',sortable:true" align="center"></th>
                <th data-options="field:'operation',width:160,title:'操作'" align="center"></th>
            </tr>
            </thead>
        </table>

        <!----------------------- wei start --------------------->
        <!--导出Excel -->
        <input type="hidden" id="excel_error" value="${requestScope.excel_error }"/>
        <script type="text/javascript">
            //导出
            function excelexport() {
                $("form").attr("action", "${ctx}/business/projectmanage/export")
                $("form").submit();

                var val = $("#excel_error").val();
                if (val != "") {//不为空提示错误消息
                    top.$.messager.alert("操作提示", val, "error");
                }
            }

        </script>
        <!----------------------- wei end --------------------->
    </div>
</div>
<div id="bindPicDialog"></div>
<div id="selPicDialog"></div>
<div id="noCompetReasonDialog"></div>
<div id="projectPause"></div>
</body>
<script type="text/javascript">
    //初始化表格对应的js对象
    var projectsParamObj;
    $(function () {
        //初始化表格对象数据
        projectsParamObj = new initParams(
            {
                paramObjName: 'projectsParamObj',//表格对应的实体对象名称，好区分多个表格情况下的对象
                tableId: 'listProjectsTable',
                addDataFormId: 'addProjectsDataForm',
                showDialogId: 'firstLevelDialog',
                searchID: 'searchProjects',
                resetSearchID: 'resetsearchProjects',
                searchFormID: 'searchProjectsForm',
                updateUrl: "${ctx}/business/projectmanage/input?projectId=",
                deleteUrl: '${ctx}/business/projectmanage/remove',
                addDialogWidth: 700,
                addDialogHeight: 520,
                ctx: '${ctx}',
                addDialogTitle: '采购项目信息'
            });
        //初始化查询
        init(projectsParamObj);
    });

    /**
     * 操作按钮处理
     * @param {Object} value
     * @param {Object} row
     * @param {Object} index
     */
    function getOptionsBtn(value, row, index) {
        return btnsHtml + "</span>";
    }


    /**
     *编制审核校验
     **/
    function auditInput(id, type) {
        debugger;
        $.ajax({
            type: "POST",
            timeout: 20000,
            url: "${ctx}/business/projectmanage/buyer/validateBuySure",
            success: function (data) {
                if (data) {
                    validateTimeOk(id, type);
                } else {
                    top.$.messager.alert('提示', "当前时间已超过16:30,无法进行确认！", 'error');
                }
            },
            error: function (res) {
                top.$.messager.alert('提示', i18n.requestError, 'error');
            }
        });
    }

    /**
     *项目审核页面
     */
    function validateTimeOk(id) {
        top.$('#firstLevelDialog').dialog({
            title: "项目审核",
            iconCls: 'icon-view',
            width: '600',
            height: '300',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auction/business/centerAuditor/auditInput?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                id: 'commitEntityBt',
                iconCls: 'icon-ok',
                handler: function () {
                    //获取表单数据
                    var cancelReason = top.$("#cancelReason").val();
                    if (cancelReason == "" && !top.$("#auditPass").is(':checked')) {
                        top.$.messager.alert("提示", '请输入原因!', "error");
                        return;
                    }
                    loadinginfo();//显示加载框
                    top.$('#commitEntityBt').linkbutton('disable');
                    $.ajax({
                        type: "post",
                        url: "${ctx}/auction/business/centerAuditor/approve?r=" + new Date().getTime(),
                        data: top.$("#projectsDataForm").serialize(),
                        success: function (data) {
                            debugger
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            if (data == "saveSuccess") {
                                top.$.messager.alert("提示", '提交成功', 'info', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else if (data == "postbankfaill") {
                                top.$.messager.alert('提示', "推送投标保证金信息至银行失败，请联系系统管理员！", 'error', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else if (data == "false") {
                                top.$.messager.alert('提示', "当前时间已超过16:30,无法进行确认！", 'error');
                            } else {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        },
                        error: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            top.$.messager.alert("提示", '提交失败!', "error");
                        }
                    });
                }
            }
                , {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }]
        });
        top.$('#firstLevelDialog').dialog("center");
    }

    /*暂停流程*/
    function projectPause(id, category) {
        top.$('#firstLevelDialog').dialog({
            title: "暂停流程",
            iconCls: 'icon-view',
            width: '865',
            height: '325',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectPause/leader/prjectPauserPage?projectId=" + id + "&category=" + category,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '提交申请',
                    iconCls: 'icon-ok',
                    handler: function () {
                        top.$('#myform').form('submit', {
                            url: "${ctx}/business/projectPause/leader/saveProjectPause?resultString=0",
                            onSubmit: function () {
                                if (!$('#myform').form('validate')) {
                                    top.$.messager.alert('提示信息', '验证没有通过,不能提交表单!', 'info');
                                    return false; //当表单验证不通过的时候 必须要return false
                                }
                            },
                            success: function (data) {
                                if (data == "saveSuccess") {
                                    top.$.messager.alert('提示信息', '提交成功!', 'info', function () {
                                        top.$('#firstLevelDialog').dialog('close');
                                        $('#listProjectsTable').datagrid('reload');
                                    });
                                    $('#listProjectsTable').datagrid('reload');
                                } else if (data == "reasonnull") {
                                    top.$.messager.alert('提示信息', '原因不为空!', 'info');
                                }

                            }

                        });
                    }
                }
                ,
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }

            ],
            onClose: function () {// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
                top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
                top.$("#dealDeclareUpload").uploadify('destroy');//销毁文件上传对象....
                afterClosed();
            }
        });
        top.$('#firstLevelDialog').dialog("center");
    }

    //提交撤销申请
    function projectRevoke(id, category) {
        $('#projectPause').dialog({
            title: "项目撤销",
            iconCls: 'icon-view',
            width: '600',
            height: '225',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectPause/leader/toRevokePageJ?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '提交',
                    iconCls: 'icon-ok',
                    handler: function () {
                        $('#myform').form('submit', {
                            url: '${ctx}/business/projectPause/leader/revokeApplyJ?pauseCategory=' + category,
                            onSubmit: function () {
                                if (!$('#myform').form('validate')) {
                                    top.$.messager.alert('提示信息', '验证没有通过,不能提交表单！', 'info');

                                    return false; //当表单验证不通过的时候 必须要return false
                                }
                            },
                            success: function (data) {
                                if (data == "saveSuccess") {
                                    top.$.messager.alert('提示信息', '项目撤销申请提交成功！', 'info', function () {
                                        $('#projectPause').dialog('close');
                                        $('#listProjectsTable').datagrid('reload');
                                    });
                                }
                                else if (data == "reasonnull") {
                                    top.$.messager.alert('提示信息', '撤销原因不为空！', 'info');
                                } else {
                                    top.$.messager.alert('提示信息', '项目撤销申请提交失败！', 'info');
                                }
                            }

                        });
                    }

                }
                ,
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        $('#projectPause').dialog('close');
                    }
                }

            ],

        });
        $('#projectPause').dialog("center");

    }


    //提交流标申请
    function flowApply(id) {
        $('#projectPause').dialog({
            title: "项目流标",
            iconCls: 'icon-view',
            width: '600',
            height: '225',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectPause/leader/toflowPage?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '提交',
                    iconCls: 'icon-ok',
                    handler: function () {
                        $('#myform').form('submit', {
                            url: '${ctx}/business/projectPause/leader/flowApply',
                            onSubmit: function () {
                                if (!$('#myform').form('validate')) {
                                    top.$.messager.alert('提示信息', '验证没有通过,不能提交表单！', 'info');

                                    return false; //当表单验证不通过的时候 必须要return false
                                }
                            },
                            success: function (data) {
                                if (data == "saveSuccess") {
                                    top.$.messager.alert('提示信息', '项目流标申请提交成功！', 'info', function () {
                                        $('#projectPause').dialog('close');
                                        $('#listProjectsTable').datagrid('reload');
                                    });
                                }
                                else if (data == "reasonnull") {
                                    top.$.messager.alert('提示信息', '撤销原因不为空！', 'info');
                                } else {
                                    top.$.messager.alert('提示信息', '项目撤销申请提交失败！', 'info');
                                }
                            }

                        });
                    }

                }
                ,
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        $('#projectPause').dialog('close');
                    }
                }

            ],

        });
        $('#projectPause').dialog("center");

    }


    //提交重启申请（竞价/中标）
    function projectRestore(id, category) {
        $('#projectPause').dialog({
            title: "项目重启",
            iconCls: 'icon-view',
            width: '600',
            height: '225',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectPause/leader/toRestartPage?projectId=" + id + "&category=" + category,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '提交',
                    iconCls: 'icon-ok',
                    handler: function () {
                        $('#myform').form('submit', {
                            url: '${ctx}/business/projectPause/leader/restartApply',
                            onSubmit: function () {
//									    if (!$('#myform').form('validate')) {
//									 //  top.$.messager.alert('提示','选择时间有误,请重新选择!','info');
//									  		 top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
//											return false; //当表单验证不通过的时候 必须要return false
//										   }
                            },
                            success: function (data) {
                                if (data == "saveSuccess") {
                                    top.$.messager.alert('提示信息', '项目重启申请成功,请等待管理员审核', 'info', function () {
                                        $('#projectPause').dialog('close');
                                        $('#listProjectsTable').datagrid('reload');
                                    });
                                } else {
                                    top.$.messager.alert('提示信息', '项目重启申请失败！', 'error');
                                }
                            }
                        });
                    }

                }
                ,
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        $('#projectPause').dialog('close');
                    }
                }

            ],

        });
        $('#projectPause').dialog("center");

    }


    //关闭
    function afterClosed() {
        // 在弹出对话框内找到Uploadify插件，并隐藏之。
        top.$.find('.upload').hide();
        // 将弹出对话框还原成弹出前的状态，并清空里面的内容。
        top.$('#firstLevelDialog').dialog('destroy').empty();
    }

    //加载数据loading
    function loading() {
        top.$('#secondtLevelDialog').dialog({
            closable: false,
            title: '数据加载',
            width: '300',
            height: '180',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/commons/js/loading/loading.html",
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            }
        });
        top.$('#secondtLevelDialog').dialog("center");
    }


    /*
   *查看结果(中标/流标结果)
   */
    function viewNotifyResult(id) {
        top.$('#firstLevelDialog').dialog({
            title: "查看结果",
            iconCls: 'icon-view',
            width: '1000',
            height: '600',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectmanage/buyer/viewNotifyResult?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],

        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /*
    * 中标确认操作
    **/
    function hitConfirm(id) {
        top.$('#firstLevelDialog').dialog({
            title: "中心确认",
            iconCls: 'icon-view',
            width: '600',
            height: '300',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectNb/centerAuditor/hitConfirm?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                id: 'commitEntityBt',
                iconCls: 'icon-ok',
                handler: function () {
                    //获取表单数据
                    var cancelReason = top.$("#cancelReason").val();
                    if (cancelReason == "" && !top.$("#auditPass").is(':checked')) {
                        top.$.messager.alert("提示", '请输入原因!', "error");
                        return;
                    }
                    loadinginfo();//显示加载框
                    top.$('#commitEntityBt').linkbutton('disable');
                    $.ajax({
                        type: "post",
                        url: "${ctx}/business/projectNb/centerAuditor/doSubmitHitConfirm?r=" + new Date().getTime(),
                        data: top.$("#projectsDataForm").serialize(),
                        success: function (data) {
                            debugger
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            if (data == "success") {
                                top.$.messager.alert("提示", '提交成功', 'info', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else if (data == "postbanexecutekfaill") {
                                top.$.messager.alert('提示', "推送履约保证金信息至银行失败，请联系系统管理员！", 'error');
                                $('#listProjectsTable').datagrid('reload');
                                top.$('#firstLevelDialog').dialog('close');
                            } else {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        },
                        error: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            top.$.messager.alert("提示", '提交失败!', "error");
                        }
                    });
                }
            }
                , {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }]
        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     * 发放中标通知书
     */
    function noticBidInfo(id) {
        top.$.messager.confirm('提示', "您确认要发放本项目中标通知书、项目合同吗？", function (result) {
            if (result) {
                $.ajax({
                    type: "post",
                    url: "${ctx}/business/projectNb/centerAuditor/noticBidInfo?id=" + id,
                    success: function (data, res) {
                        var result = $.trim(res.responseText);
                        if (result == "unLogin") {
                            var msn = '' || i18n[''];
                            msn = msn || i18n[result];
                            if (msn != undefined) {
                                top.$.messager.alert('提示', msn, 'info', function () {
                                    top.location = '${ctx}/user-login-sys-new/loginPwd';
                                });
                                return;
                            }
                        }
                        top.$.messager.alert("提示", '请联系财务管理员于5个工作日内退还非中标人投标保证金!', 'info', function () {
                            $('#listProjectsTable').datagrid('reload');
                        });

                    },
                    error: function (res) {
                        $.messager.alert('提示', i18n.requestError, 'error');
                    }
                });
            }
        });
    }

    /**打印中标通知书**/
    function printWinbidAlert(id) {
        top.$('#firstLevelDialog').dialog({
            title: "中标通知书",
            iconCls: 'icon-view',
            width: '665',
            height: '325',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectNb/printWinbidAlert?projectId=" + id + "&isShow=false",
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '取消',
                iconCls: 'icon-cancel',
                handler: function () {
                    top.$('#firstLevelDialog').dialog('close');
                }
            }],

        });
        top.$('#firstLevelDialog').dialog("center");
    }

    /**
     *合同审核页面
     */
    function contractAudit(id) {
        top.$('#firstLevelDialog').dialog({
            title: "合同审核",
            iconCls: 'icon-view',
            width: '600',
            height: '300',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectNb/centerAuditor/contractAuditInput?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                id: 'commitEntityBt',
                iconCls: 'icon-ok',
                handler: function () {
                    //获取表单数据
                    debugger;
                    var cancelReason = top.$("#cancelReason").val();
                    if (cancelReason == "" && !top.$("#auditPass").is(':checked')) {
                        top.$.messager.alert("提示", '请输入原因!', "error");
                        return;
                    }
                    loadinginfo();//显示加载框
                    top.$('#commitEntityBt').linkbutton('disable');
                    $.ajax({
                        type: "post",
                        url: "${ctx}/business/projectNb/centerAuditor/contractAudit?r=" + new Date().getTime(),
                        data: top.$("#projectsDataForm").serialize(),
                        success: function (data) {
                            debugger
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            if (data == "success") {
                                top.$.messager.alert("提示", '提交成功', 'info', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        },
                        error: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            top.$.messager.alert("提示", '提交失败!', "error");
                        }
                    });
                }
            }
                , {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }]
        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     * 结项操作
     */
    function endProject(id) {
        $.messager.confirm('提示', "您确定要结束项目吗？", function (result) {
            if (result) {
                $.ajax({
                    type: "post",
                    url: "${ctx}/business/projectNb/centerAuditor/endProject?projectId=" + id,
                    success: function (data, res) {
                        var result = $.trim(res.responseText);
                        if (result == "unLogin") {
                            var msn = '' || i18n[''];
                            msn = msn || i18n[result];
                            if (msn != undefined) {
                                top.$.messager.alert('提示', msn, 'info', function () {
                                    top.location = '${ctx}/user-login-sys-new/loginPwd';
                                });
                                return;
                            }
                        }
                        top.$.messager.alert("提示", '操作成功!', 'info', function () {
                            $('#listProjectsTable').datagrid('reload');
                        });

                    },
                    error: function (res) {
                        $.messager.alert('提示', i18n.requestError, 'error');
                    }
                });
            }
        });
    }


    /**
     *质疑投诉
     */
    function oppugn(id) {
        top.$('#firstLevelDialog').dialog({
            title: "质疑投诉",
            iconCls: 'icon-view',
            width: '900',
            height: '500',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auctionBid/business/leader/oppugnInput?id=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons:
                [{
                    text: '提交',
                    iconCls: 'icon-ok',
                    handler: function () {
                        var contentMsg = top.getEditorHTMLContents();
                        if (contentMsg == '') {
                            top.$.messager.alert('提示', "请输入内容", 'error');
                            return false;
                        }
                        if (top.$('#addContentDataForm').form('validate')) {//表单校验是否通过
                            //获取富文本中的文字
                            top.$('#contentMsg').val(top.getEditorHTMLContents());
                            $.ajax({
                                type: "post",
                                url: "${ctx}/business/webcontent/save",
                                data: top.$('#addContentDataForm').serialize(),
                                success: function (data, res) {
                                    var result = $.trim(res.responseText);
                                    if (result == "unLogin") {
                                        var msn = '' || i18n[''];
                                        msn = msn || i18n[result];
                                        if (msn != undefined) {
                                            top.$.messager.alert('提示', msn, 'info', function () {
                                                top.location = '${ctx}/user-login-sys-new/loginPwd';
                                            });
                                            return;
                                        }
                                    }
                                    top.$.messager.alert("提示", '操作成功!', 'info', function () {
                                        $('#listProjectsTable').datagrid('reload');
                                    });

                                },
                                error: function (res) {
                                    $.messager.alert('提示', i18n.requestError, 'error');
                                }
                            });
                            top.$('#firstLevelDialog').dialog('close');
                        }
                    }
                }, {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],
            onClose: function () {// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
                top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
                afterClosed();
            }
        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     *项目详情
     */
    function getProjectDetail(id) {
        top.$('#firstLevelDialog').dialog({
            title: "项目详情",
            iconCls: 'icon-view',
            width: 1000,
            height: 580,
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auction/business/getProjectDetail?projectId=" + id + "&roleId=centerAuditor",
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: projectsParamObj.cancelButton,
                iconCls: 'icon-cancel',
                handler: function () {
                    top.$('#firstLevelDialog').dialog('close');
                }
            }]
        });
        top.$('#' + projectsParamObj.showDialogId).dialog("center");
    }

    //变更公告
    function editPublish(id) {
        top.$('#firstLevelDialog').dialog({
            title: "变更公告",
            iconCls: 'icon-view',
            width: '900',
            height: '500',
            closed: false,
            inline: true,
            cache: false,
            <%--href: "${ctx}/business/projectmanage/leader/editPublish?projectId="+id,--%>
            href: "${ctx}/auctionBid/business/leader/editPublish?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons:
                [{
                    text: '提交',
                    iconCls: 'icon-ok',
                    handler: function () {
                        if (top.$('#addContentDataForm').form('validate')) {//表单校验是否通过
                            //获取富文本中的文字
                            top.$('#contentMsg').val(top.getEditorHTMLContents());
                            $.ajax({
                                type: "post",
                                url: "${ctx}/business/webcontent/save",
                                data: top.$('#addContentDataForm').serialize(),
                                success: function (data, res) {
                                    var result = $.trim(res.responseText);
                                    if (result == "unLogin") {
                                        var msn = '' || i18n[''];
                                        msn = msn || i18n[result];
                                        if (msn != undefined) {
                                            top.$.messager.alert('提示', msn, 'info', function () {
                                                top.location = '${ctx}/user-login-sys-new/loginPwd';
                                            });
                                            return;
                                        }
                                    }
                                    top.$.messager.alert("提示", '操作成功!', 'info', function () {
                                        $('#listProjectsTable').datagrid('reload');
                                    });

                                },
                                error: function (res) {
                                    $.messager.alert('提示', i18n.requestError, 'error');
                                }
                            });
                            top.$('#firstLevelDialog').dialog('close');
                        }
                    }
                }, {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],
            onClose: function () {// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
                top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
                afterClosed();
            }
        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     * 评标之后补录评标过程的资料
     */
    function supplementFile(id) {
        top.$('#firstLevelDialog').dialog({
            title: "补录资料",
            iconCls: 'icon-view',
            width: '900',
            height: '500',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectNb/supplementFile?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                iconCls: 'icon-ok',
                handler: function () {
                    if (top.$('#addDataForm').form('validate')) {//表单校验是否通过
                        //alert("提交按钮操作");
                        $.ajax({
                            type: "post",
                            url: "${ctx}/business/projectNb/doSupplementFile?r=" + new Date().getTime(),
                            data: top.$("#addDataForm").serialize(),
                            success: function (data) {
                                if (data == "success") {
                                    //top.$(".upload").uploadify('destroy');//销毁文件上传对象....
                                    top.$.messager.alert("提示", '提交成功', 'info', function () {
                                        $('#listProjectsTable').datagrid('reload');
                                        top.$('#firstLevelDialog').dialog('close');
                                    });
                                }
                                else {
                                    top.$.messager.alert("提示", '提交失败!', "error");
                                }
                            },
                            error: function (data) {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        });
                    }

                }
            },
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],
            onClose: function () {// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
                top.$(".uploadify").each(function () {
                    var uploadId = $(this).parent().parent().find(".uploadify").attr("id");
                    top.$("#" + uploadId).uploadify('destroy');//销毁文件上传对象....
                });
                afterClosed();
            }
        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     * 打开归档资料选择页面
     */
    function pigeonhole(id) {//
        top.$('#firstLevelDialog').dialog({
            title: "归档操作",
            iconCls: 'icon-view',
            width: '665',
            height: '525',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/business/projectNb/leader/pigeonholeInput?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '一键导出',
                    iconCls: 'icon-ok',
                    handler: function () {
                        top.$("#pigeonholeForm").submit();
                        top.$('#firstLevelDialog').dialog('close');

                    }

                }
                ,
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],

        });
        top.$('#firstLevelDialog').dialog("center");
    }

    //撤销项目（已审核）
    function revoke(id) {
        top.$.messager.confirm('确认', '业务管理员已经通过您的撤销申请,是否要撤销项目?', function (r) {
            if (r) {
                $.ajax({
                    url: '${ctx}/business/projectPause/leader/revoke?projectId=' + id,
                    cache: false,
                    type: 'post',
                    success: function (data) {
                        top.$.messager.alert("提示", '撤销成功', 'info', function () {
                            $('#listProjectsTable').datagrid('reload');
                        });
                    }
                });
            }
        });

    }

    //流标项目（已审核）
    function flow(id) {
        top.$.messager.confirm('确认', '业务管理员已经通过您的流标申请,是否要流标项目?', function (r) {
            if (r) {
                $.ajax({
                    url: '${ctx}/business/projectPause/leader/flow?projectId=' + id,
                    cache: false,
                    type: 'post',
                    success: function (data) {
                        top.$.messager.alert("提示", '流标成功', 'info', function () {
                            $('#listProjectsTable').datagrid('reload');
                        });
                    }
                });
            }
        });
    }

    //重启项目（已审核）(竞价公示)
    function restoreJ(id) {
        top.$.messager.confirm('确认', '业务管理员已经通过您的重启申请,是否要重启项目?', function (r) {
            if (r) {
                $('#projectPause').dialog({
                    title: "项目重启",
                    iconCls: 'icon-view',
                    width: '600',
                    height: '225',
                    closed: false,
                    inline: true,
                    cache: false,
                    href: "${ctx}/business/projectPause/leader/toRestoreJPage?projectId=" + id,
                    modal: true,
                    extractor: function (data) {
                        if ($.trim(data) == "unLogin") {
                            var msn = '' || i18n[''];
                            msn = msn || i18n[data];
                            if (msn != undefined) {
                                top.$.messager.alert('提示', msn, 'info', function () {
                                    top.location = '${ctx}/user-login-sys-new/loginPwd';
                                });
                                return '';
                            }
                        }
                        return data;
                    },
                    buttons: [
                        {
                            text: '提交',
                            iconCls: 'icon-ok',
                            handler: function () {
                                $('#myform').form('submit', {
                                    url: "${ctx}/business/projectPause/leader/restoreJ",
                                    onSubmit: function () {
                                        if (!$('#myform').form('validate')) {
                                            top.$.messager.alert('提示', '选择时间有误,请重新选择!', 'info');
                                            return false; //当表单验证不通过的时候 必须要return false
                                        }
                                    },
                                    success: function (data) {
                                        if (data == "saveSuccess") {
                                            top.$.messager.alert('提示信息', '项目重启成功!', 'info', function () {
                                                $('#projectPause').dialog('close');
                                                $('#listProjectsTable').datagrid('reload');
                                            });
                                        } else {
                                            top.$.messager.alert('提示信息', '项目重启申请失败！', 'error');
                                        }
                                    }
                                });
                            }

                        }
                        ,
                        {
                            text: '取消',
                            iconCls: 'icon-cancel',
                            handler: function () {
                                $('#projectPause').dialog('close');
                            }
                        }

                    ],

                });
                $('#projectPause').dialog("center");
            }
        });

    }


    //重启项目（中标公示）
    function restoreZ(id) {
        top.$.messager.confirm('确认', '业务管理员已经通过您的重启申请,是否要重启项目?', function (r) {
            if (r) {
                $('#projectPause').dialog({
                    title: "项目重启",
                    iconCls: 'icon-view',
                    width: '600',
                    height: '225',
                    closed: false,
                    inline: true,
                    cache: false,
                    href: "${ctx}/business/projectPause/leader/toRestoreZPage?projectId=" + id,
                    modal: true,
                    extractor: function (data) {
                        if ($.trim(data) == "unLogin") {
                            var msn = '' || i18n[''];
                            msn = msn || i18n[data];
                            if (msn != undefined) {
                                top.$.messager.alert('提示', msn, 'info', function () {
                                    top.location = '${ctx}/user-login-sys-new/loginPwd';
                                });
                                return '';
                            }
                        }
                        return data;
                    },
                    buttons: [
                        {
                            text: '提交',
                            iconCls: 'icon-ok',
                            handler: function () {
                                $('#myform').form('submit', {
                                    url: "${ctx}/business/projectPause/leader/restoreZ",
                                    onSubmit: function () {
                                        if (!$('#myform').form('validate')) {
                                            top.$.messager.alert('提示', '选择时间有误,请重新选择!', 'info');
                                            return false; //当表单验证不通过的时候 必须要return false
                                        }
                                    },
                                    success: function (data) {
                                        if (data == "saveSuccess") {
                                            top.$.messager.alert('提示信息', '项目重启成功!', 'info', function () {
                                                $('#projectPause').dialog('close');
                                                $('#listProjectsTable').datagrid('reload');
                                            });
                                        } else {
                                            top.$.messager.alert('提示信息', '项目重启申请失败！', 'error');
                                        }
                                    }
                                });
                            }

                        }
                        ,
                        {
                            text: '取消',
                            iconCls: 'icon-cancel',
                            handler: function () {
                                $('#projectPause').dialog('close');
                            }
                        }

                    ],

                });
                $('#projectPause').dialog("center");
            }
        });

    }


    /**
     *中标结果审核页面
     */
    function viewCenterReslutAudit(id, obj) {
        top.$('#firstLevelDialog').dialog({
            title: $(obj).text(),
            iconCls: 'icon-view',
            width: '600',
            height: '300',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auctionBid/business/centerAuditor/viewCenterReslutAudit?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                id: 'commitEntityBt',
                iconCls: 'icon-ok',
                handler: function () {
                    //获取表单数据
                    var reason = $.trim(top.$("#reason").val());
                    if (reason == "" && !top.$("#auditPass").is(':checked')) {
                        top.$.messager.alert("提示", '请输入原因!', "error");
                        return;
                    }
                    loadinginfo();//显示加载框
                    top.$('#commitEntityBt').linkbutton('disable');
                    $.ajax({
                        type: "post",
                        url: "${ctx}/auctionBid/business/centerAuditor/centerReslutAudit?r=" + new Date().getTime(),
                        data: top.$("#projectsDataForm").serialize(),
                        success: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            if (data == "success") {
                                top.$.messager.alert("提示", '提交成功', 'info', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else if (data == "unsuccess") {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                            else {
                                top.$.messager.alert("提示", data, "error");
                            }
                        },
                        error: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            top.$.messager.alert("提示", '提交失败!', "error");
                        }
                    });
                }
            }
                , {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }]
        });
        top.$('#firstLevelDialog').dialog("center");
    }

    /*
     *预览公告(中标/流标结果)
     */
    function previewWinnerNotice(id) {
        top.$('#firstLevelDialog').dialog({
            title: "预览公告",
            iconCls: 'icon-view',
            width: '1000',
            height: '600',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auctionBid/business/owner/previewWinnerNotice?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],

        });
        top.$('#firstLevelDialog').dialog("center");
    }


    /**
     *合同审核页面
     */
    function viewContractAudit(id) {
        top.$('#firstLevelDialog').dialog({
            title: "合同审核",
            iconCls: 'icon-view',
            width: '600',
            height: '300',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auctionBid/business/centerAuditor/viewContractAuditInput?projectId=" + id,
            modal: true,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                id: 'commitEntityBt',
                iconCls: 'icon-ok',
                handler: function () {
                    //获取表单数据
                    var cancelReason = top.$("#cancelReason").val();
                    if (cancelReason == "" && !top.$("#auditPass").is(':checked')) {
                        top.$.messager.alert("提示", '请输入原因!', "error");
                        return;
                    }
                    loadinginfo();//显示加载框
                    top.$('#commitEntityBt').linkbutton('disable');
                    $.ajax({
                        type: "post",
                        url: "${ctx}/auctionBid/business/centerAuditor/contractAudit?r=" + new Date().getTime(),
                        data: top.$("#projectsDataForm").serialize(),
                        success: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            if (data == "success") {
                                top.$.messager.alert("提示", '提交成功', 'info', function () {
                                    $('#listProjectsTable').datagrid('reload');
                                    $('#listNBProjectsTable').datagrid('reload');
                                    top.$('#firstLevelDialog').dialog('close');
                                });
                            } else {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        },
                        error: function (data) {
                            top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
                            top.$.messager.alert("提示", '提交失败!', "error");
                        }
                    });
                }
            }
                , {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }]
        });
        top.$('#firstLevelDialog').dialog("center");
    }

    //解锁合同
    function unlock(id) {
        $.messager.confirm('确认对话框', '解除锁定？', function (r) {
            if (r) {
                $.ajax({
                    type: 'post',
                    url: '${ctx}/auctionBid/business/centerAuditor/unlockContract',
                    data: {projectId: id},
                    success: function (data) {
                        if (data == "saveSuccess") {
                            top.$.messager.alert('提示信息', '解锁成功！', 'info');
                            /*  $.messager.show({
                             title:"提示信息",
                             msg:"解锁成功！"
                             });*/
                        } else if (data == "") {
                            top.$.messager.alert('提示信息', '解锁失败！', 'info');
                            /*$.messager.show({
                             title:"提示信息",
                             msg:"解锁失败！"
                             });*/
                        }

                    }

                });
                $('#listProjectsTable').datagrid('reload');
            }
        });
    }

    /**
     * 发放中标通知书
     */
    function sendNoticBidInfo(projectId) {
        top.$.messager.confirm('提示', "您确认要发放本项目中标通知书？", function (result) {
            if (result) {
                $.ajax({
                    type: "post",
                    url: "${ctx}/auctionBid/business/centerAuditor/noticBidInfo?projectId=" + projectId,
                    success: function (data, res) {
                        var result = $.trim(res.responseText);
                        if (result == "unLogin") {
                            var msn = '' || i18n[''];
                            msn = msn || i18n[result];
                            if (msn != undefined) {
                                top.$.messager.alert('提示', msn, 'info', function () {
                                    top.location = '${ctx}/user-login-sys-new/loginPwd';
                                });
                                return;
                            }
                        }
                        top.$.messager.alert("提示", '操作成功!', 'info', function () {
                            $('#listProjectsTable').datagrid('reload');
                        });

                    },
                    error: function (res) {
                        $.messager.alert('提示', i18n.requestError, 'error');
                    }
                });
            }
        });
    }

    /**打印中标通知书**/
    function viewPrintWinbidAlert(id) {
        window.open("${ctx}/auctionBid/business/viewPrintWinbidAlert?projectId=" + id + "&isShow=false");
    }


    /**
     * 补充资料
     */
    function viewWupplementData(id) {
        top.$('#firstLevelDialog').dialog({
            title: "补录资料",
            iconCls: 'icon-view',
            width: '900',
            height: '500',
            closed: false,
            inline: true,
            cache: false,
            href: "${ctx}/auctionBid/business/viewWupplementData?projectId=" + id,
            modal: true,
            close: afterClosed,
            extractor: function (data) {
                if ($.trim(data) == "unLogin") {
                    var msn = '' || i18n[''];
                    msn = msn || i18n[data];
                    if (msn != undefined) {
                        top.$.messager.alert('提示', msn, 'info', function () {
                            top.location = '${ctx}/user-login-sys-new/loginPwd';
                        });
                        return '';
                    }
                }
                return data;
            },
            buttons: [{
                text: '提交',
                iconCls: 'icon-ok',
                handler: function () {
                    if (top.$('#addDataForm').form('validate')) {//表单校验是否通过
                        //alert("提交按钮操作");
                        $.ajax({
                            type: "post",
                            url: "${ctx}/auctionBid/business/doSupplementFileData?r=" + new Date().getTime(),
                            data: top.$("#addCancelResonForm").serialize(),
                            success: function (data) {
                                if (data == "success") {
                                    //top.$(".upload").uploadify('destroy');//销毁文件上传对象....
                                    top.$.messager.alert("提示", '提交成功', 'info', function () {
                                        $('#listProjectsTable').datagrid('reload');
                                        top.$('#firstLevelDialog').dialog('close');
                                    });
                                }
                                else {
                                    top.$.messager.alert("提示", '提交失败!', "error");
                                }
                            },
                            error: function (data) {
                                top.$.messager.alert("提示", '提交失败!', "error");
                            }
                        });
                    }

                }
            },
                {
                    text: '取消',
                    iconCls: 'icon-cancel',
                    handler: function () {
                        top.$('#firstLevelDialog').dialog('close');
                    }
                }],
            onClose: function () {// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
                top.$(".uploadify").each(function () {
                    var uploadId = $(this).parent().parent().find(".uploadify").attr("id");
                    top.$("#" + uploadId).uploadify('destroy');//销毁文件上传对象....
                });
                top.$(".fileQueue").uploadify('destroy');//销毁文件上传对象....
                afterClosed();
            }
        });
        top.$('#firstLevelDialog').dialog("center");
    }
</script>